:root {
    --background-color: #2c3e50;
    --border-color: #34495e;
    --text-color: #7591AD;
    --color1: #EC3E27;
    --color2: #fd79a8;
    --color3: #0984e3;
    --color4: #00b894;
    --color5: #fdcb6e;
    --color6: #e056fd;
    --color7: #F97F51;
    --color8: #BDC581;
}

* {
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
}

body {
    width: 100vw;
    height: 100vh;
    background-color: var(--background-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Montserrat', sans-serif, Arial, 'Microsoft Yahei';
}

/* 原教程中使用的是第三方库 */

/* 这里使用iconfont.cn的图标导出 */

@font-face {
    font-family: "iconfont";
    src: url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAKsAAsAAAAABnAAAAJeAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCCcAp8gRgBNgIkAwgLBgAEIAWEbQcwG74FEdWTB2Q/DuyY8FcY0Z8Dxdjg34Pn37W3+5LMb0qoAFARg6qrQ14wdv8cv+DJEUhAt3rM2ozizqgIRZOMB/9VUzbQw+RyXwLAiMNp87wLZP55l8sYg8aaNKmL4jiQAhxrUWRFEnnD2AUu4TgECCKRfKSppWsIi8EaJ4Bsra/OY3NeDIYlLIKvZqlBbnGw6ky9hJvw+/K7VCwoHI1V0rfSvETdt0I7Re96u0z5BHwgoNUOoIF8wIAM1UZ70Aija4KihlTYV6HAt8zzfAuyVyPC/jorPwSAeCi6J7EruVVuBYCB7pAK1I66DXRQSMjOw92YmAfncSPv7XfvRt+8GX79eujt25FIkBVAPryltjj3cfLjfy+Snz971t7+ol0duO6BOlR+VwU013/AJ6kbh9r99cv15Bq2aDf9HeoA8HYNehcBBCrCyh7Nhlf9t8EGgE8hozuU9LOD3b9N4D+JezYYXWqZlVHFtUlFKvr8ZUEEAR7YGcXXsbrYm0oKlthbsweQkEJjSScaaj4cgimHD0stgsijdXUw0WyjERMI5HIEIETghyKMZ9BE8IpoqF/gEMdf+IgQjSBGJHrLYDJFW1yjojOM1P9pGeRkx2ouKrxhCnunWWnIeEH9EqAyK4qJFid0jhn+M1VmTKxyUANOw74LXSorBstms6vOc657UzbIEbmoUdEZRur/tAxyst/eXOnzN0xh77Slrsb7gvqldyqzogexVZ296u7lFf+ZKjMmVjmoAYOw70JX/aAVg2XziPBV53Yz7qvK1tccX7cDCIosvYrtfmnk8xJ8kCgCAAAA') format('woff2');
}

.iconfont {
    font-family: "iconfont" !important;
    font-size: 20px;
    font-style: normal;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.icon-sousuo:before {
    content: "\e62e";
}

.search-box {
    width: 60px;
    height: 60px;
    background-color: var(--border-color);
    border-radius: 60px;
    /* 垂直居中，左右居左 */
    display: flex;
    justify-content: flex-end;
    align-items: center;
    transition: 0.5s;
}

.key {
    /* flex布局中本区域的缩放比例为1份 */
    flex-shrink: 1;
    flex-grow: 1;
    /* background-color: violet; */
}

.key input {
    width: calc(100% - 40px);
    height: 40px;
    padding: 0 20px;
    font-size: 18px;
    color: #fff;
    /* 边框背景为空 */
    background: none;
    border: none;
    outline: none;
}

.key input:focus {
    border: none;
    outline: none;
}

.key input::-webkit-input-placeholder {
    /* 提示文字的样式 */
    color: #999;
}

.bt {
    /* flex布局中本区域的缩放比例为0份，不缩放，保持原有大小 */
    flex-shrink: 0;
    flex-grow: 0;
    width: 60px;
    height: 60px;
    border-radius: 100%;
    /* 搜索图标居中 */
    display: flex;
    justify-content: center;
    align-items: center;
}

.bt a {
    padding: 10px;
    border-radius: 100%;
    text-decoration: none;
    color: #fff;
    /* background-color: violet; */
    transition: 0.5s;
}

.search-box.active {
    width: 300px;
}

.search-box.active .bt a {
    background-color: var(--background-color);
}